# -*- coding: utf-8 -*-

# Scrapy settings for Snowball project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
#     https://docs.scrapy.org/en/latest/topics/settings.html
#     https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
#     https://docs.scrapy.org/en/latest/topics/spider-middleware.html

BOT_NAME = 'Snowball'

SPIDER_MODULES = ['Snowball.spiders']
NEWSPIDER_MODULE = 'Snowball.spiders'


# Crawl responsibly by identifying yourself (and your website) on the user-agent
#USER_AGENT = 'Snowball (+http://www.yourdomain.com)'

# Obey robots.txt rules
ROBOTSTXT_OBEY = False

# Configure maximum concurrent requests performed by Scrapy (default: 16)
#CONCURRENT_REQUESTS = 32

# Configure a delay for requests for the same website (default: 0)
# See https://docs.scrapy.org/en/latest/topics/settings.html#download-delay
# See also autothrottle settings and docs
#DOWNLOAD_DELAY = 3
# The download delay setting will honor only one of:
#CONCURRENT_REQUESTS_PER_DOMAIN = 16
#CONCURRENT_REQUESTS_PER_IP = 16

# Disable cookies (enabled by default)
COOKIES_ENABLED = False

# Disable Telnet Console (enabled by default)
#TELNETCONSOLE_ENABLED = False

# Override the default request headers:
DEFAULT_REQUEST_HEADERS = {
  'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  'Accept-Language': 'en',
    'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36',
    'Cookie': 'aliyungf_tc=AQAAAOTMT1hCGwIAXDiVJ6yOcjT6qFGV; acw_tc=2760821315831590751507315eba2221b97b4f7263e72743b2a55365a9963f; device_id=24700f9f1986800ab4fcc880530dd0ed; s=bk12cg21e7; __utmc=1; __utmz=1.1583159189.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); Hm_lvt_1db88642e346389874251b5a1eded6e3=1583159076,1583279808; cookiesu=471583279934092; bid=7f9069024c3983550611e5ad5a3d4241_k7ct1eag; xq_a_token=a664afb60c7036c7947578ac1a5860c4cfb6b3b5; xq_r_token=01d9e7361ed17caf0fa5eff6465d1c90dbde9ae2; xq_id_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1aWQiOi0xLCJpc3MiOiJ1YyIsImV4cCI6MTU4NTM2MjYwNywiY3RtIjoxNTgzMzAxMDg1MDk1LCJjaWQiOiJkOWQwbjRBWnVwIn0.dw2B_MWSe1qEcOLrMxyjYstO4Moasmadc34CJoNpSPv30H5R6lHU1qDCpZgwr-Yjfbsitw38OucTeITSvi4dOvCO-rTX5fwCtYDEgAVlnA69dHQp3Nlb9O6XqQezz0EZQAJJ0a5cexKY6r6L9LpZENt0Lbo4TNBYuGL01fgtrEfMTSBYTp0r1Dveg_ON_ZVsVZMKXS9vf36FMHRlYc0ybpZUoMgUfXZ_Rcy26x9bCBwkrLC0y360I23jvPs6CRrSoKp2e5ijsHltE-_5IuHn7bPQbN4sTFI3B6DumYT--2saOD-1_12sE3f1Y8loUMt1oHL5H65TqD1YLP-Qjs0ieQ; __utma=1.1714965144.1583159189.1583298841.1583301130.5; u=391583301129969; _ga=GA1.2.404416715.1583301166; _gid=GA1.2.588864180.1583301166; Hm_lpvt_1db88642e346389874251b5a1eded6e3=1583309875',

}

# Enable or disable spider middlewares
# See https://docs.scrapy.org/en/latest/topics/spider-middleware.html
#SPIDER_MIDDLEWARES = {
#    'Snowball.middlewares.SnowballSpiderMiddleware': 543,
#}

# Enable or disable downloader middlewares
# See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
DOWNLOADER_MIDDLEWARES = {
   # 'Snowball.middlewares.SnowballDownloaderMiddleware': 543,
   #  'Snowball.middlewares.HttpProxyMiddleware':543
}

# Enable or disable extensions
# See https://docs.scrapy.org/en/latest/topics/extensions.html
#EXTENSIONS = {
#    'scrapy.extensions.telnet.TelnetConsole': None,
#}

# Configure item pipelines
# See https://docs.scrapy.org/en/latest/topics/item-pipeline.html
ITEM_PIPELINES = {
   # 'Snowball.pipelines.SnowballPipeline': 300,
  # 'Snowball.pipelines.JsonWithEncodingPipeline':1
    'Snowball.pipelines.MysqlPipeline':1
}

MYSQL_HOST = 'localhost'
MYSQL_DATABASE = 'snow'
MYSQL_USER = 'root'
MYSQL_PASS = '123456'
MYSQL_PORT = 3306


# Enable and configure the AutoThrottle extension (disabled by default)
# See https://docs.scrapy.org/en/latest/topics/autothrottle.html
#AUTOTHROTTLE_ENABLED = True
# The initial download delay
#AUTOTHROTTLE_START_DELAY = 5
# The maximum download delay to be set in case of high latencies
#AUTOTHROTTLE_MAX_DELAY = 60
# The average number of requests Scrapy should be sending in parallel to
# each remote server
#AUTOTHROTTLE_TARGET_CONCURRENCY = 1.0
# Enable showing throttling stats for every response received:
#AUTOTHROTTLE_DEBUG = False

# Enable and configure HTTP caching (disabled by default)
# See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html#httpcache-middleware-settings
#HTTPCACHE_ENABLED = True
#HTTPCACHE_EXPIRATION_SECS = 0
#HTTPCACHE_DIR = 'httpcache'
#HTTPCACHE_IGNORE_HTTP_CODES = []
#HTTPCACHE_STORAGE = 'scrapy.extensions.httpcache.FilesystemCacheStorage'

